﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Small.Html.Enum;

namespace Small.Html.Options
{
   public class JqGridColModel:JqBase
    {
        TextAlign align;

        public TextAlign Align
        {
            get { return align; }
            set { align = value;
            list.Add(IsStringNull("align", align.ToString()));
            }
        }
        string classes;

        public string Classes
        {
            get { return classes; }
            set { classes = value;
            list.Add(IsStringNull("classes", classes)); ;
            }
        }
        string datefmt;

        public string Datefmt
        {
            get { return datefmt; }
            set { datefmt = value;
            list.Add(IsStringNull("datefmt", datefmt)); ;
            }
        }
        string defval;

        public string Defval
        {
            get { return defval; }
            set { defval = value;
            list.Add(IsStringNull("defval", defval)); ;
            }
        }
        bool editable = false;

        public bool Editable
        {
            get { return editable; }
            set { editable = value;
            list.Add(IsBool("editable", editable));
            }
        }
       JqEditOptions editoptions;

       public JqEditOptions Editoptions
       {
           get { return editoptions; }
           set { editoptions = value;
           if (editoptions != null)
           {
               list.Add(editoptions.GenerateString());
           }
           }
       }
       JqEditrule editrules;

       public JqEditrule Editrules
       {
           get { return editrules; }
           set { editrules = value;

           if (editrules != null)
           {
               list.Add(editrules.GenerateString());
           }
           }
       }
       JqEditType edittype;

       public JqEditType Edittype
       {
           get { return edittype; }
           set { edittype = value;
           if (editable)
           {
               list.Add(IsStringNull("edittype", edittype.ToString()));
           }
           }
       }
       string firstsortorder;

       public string Firstsortorder
       {
           get { return firstsortorder; }
           set { firstsortorder = value;
           list.Add(IsStringNull("firstsortorder", firstsortorder));
           
           }
       }
       bool @fixed;

       public bool Fixed
       {
           get { return @fixed; }
           set { @fixed = value;
           list.Add(IsBool("fixed", @fixed));
            
           }
       }
       JqGridColModelFormatter formatter;

       public JqGridColModelFormatter Formatter
       {
           get { return formatter; }
           set { formatter = value;
           list.Add(formatter.GenerateFormatterString());
           }
       }
       JqFormOptions formoptions;

       public JqFormOptions Formoptions
       {
           get { return formoptions; }
           set { formoptions = value;
           if (formoptions != null)
           {
               list.Add(formoptions.GenerateString());
           }
           }
       }
       bool hidedlg;

       public bool Hidedlg
       {
           get { return hidedlg; }
           set { hidedlg = value;
           list.Add(IsBool("hidedlg", hidedlg));
           }
       }
       bool hidden;

       public bool Hidden
       {
           get { return hidden; }
           set { hidden = value;
           list.Add(IsBool("hidden", hidden));
           }
       }
       
       
       public string Index
       {
           get { return name; }
           
       }
       string jsonmap;

       public string Jsonmap
       {
           get { return jsonmap; }
           set { jsonmap = value;
           list.Add(IsStringNull("jsonmap", jsonmap));
           }
       }
       bool key = false;

       public bool Key
       {
           get { return key; }
           set { key = value;
           list.Add(IsBool("key", key));
           }
       }

       string label;

       public string Label
       {
           get { return label; }
           set { label = value;
           list.Add(IsStringNull("label", label));
           }
       }
       string name;

       public string Name
       {
           get { return name; }
           set { name = value;
           list.Add(IsStringNull("name", name));
           list.Add(IsStringNull("index", name));
           }
       }
       bool resizable = true;

       public bool Resizable
       {
           get { return resizable; }
           set { resizable = value;
           list.Add(IsBool("resizable", resizable));
           }
       }
       JqEditOptions searchOptions;

       public JqEditOptions SearchOptions
       {
           get { return searchOptions; }
           set { searchOptions = value;
           list.Add(searchOptions.GenerateString());
           }
       }
       bool sortable = true;

       public bool Sortable
       {
           get { return sortable; }
           set { sortable = value;
           list.Add(IsBool("sortable", sortable));
           }
       }
       JqSortType sorttype;

       public JqSortType Sorttype
       {
           get { return sorttype; }
           set { sorttype = value;
           list.Add(IsStringNull("sorttype", sorttype.ToString()));
           }
       }

       string stype;

       public string Stype
       {
           get { return stype; }
           set { stype = value;
           list.Add(IsStringNull("stype", stype));
           }
       }
      
       string surl;

       public string Surl
       {
           get { return surl; }
           set { surl = value;
           list.Add(IsStringNull("surl", surl));
           }
       }
       string title;

       public string Title
       {
           get { 
               return title; }
           set { title = value;
           list.Add(IsStringNull("title", title));
           }
       }
       string width="150";

       public string Width
       {
           get { return width; }
           set { width = value;
           list.Add(IsStringNull("width", width));
           }
       }

       string xmlmap;

       public string Xmlmap
       {
           get { return xmlmap; }
           set { xmlmap = value;
           list.Add(IsStringNull("xmlmap", xmlmap));
           }
       }

       string unformat;

       public string Unformat
       {
           get { return unformat; }
           set { unformat = value;
           list.Add(IsStringNull("unformat", unformat));
           }
       }

       bool viewable;

       public bool Viewable
       {
           get { return viewable; }
           set { viewable = value;
           list.Add(IsBool("viewable", viewable));
           }
       }

       List<String> list = new List<string>();
       public override string GenerateString()
       {
          
           
          
          
          
           
           
          
          
         
           return "{" + string.Join(",", list.ToArray()) + OthertAtributes + " } ";
       }
    }
}
